#ifndef OPDEF_H
#define OPDEF_H

#include <complex>

typedef enum AluOpCode
{
    NOP = 0,
    ADD = 1,
    SUB = 2,
    MUL = 3,
    DIV = 4,
    PUT = 20,
    WAIT = 70,
    HALT = 100,
} AluOpCode;

typedef enum TranOpCode
{
    LD = 0,
    CLR = 1,
} TranOpCode;

typedef enum AllocOpCode
{
    DQ = 0,
} AllocOpCode;

typedef struct ExecOp
{
    int alu;
    int peer_id;
    int len_limit;
    AluOpCode op_code;
    bool dst_addr;
    int dst_increase;
    bool dst_enable_offset;
    int dst_peer_id;
    int dst_stride;
    bool dst_sb;
    int src_addr_0;
    bool src_wait_passin_0;
    bool src_wait_aluin_0;
    bool src_enable_offset_0;
    int src_stride_0;
    int src_limit_0;
    int src_addr_1;
    bool src_wait_passin_1;
    bool src_wait_aluin_1;
    bool src_enable_offset_1;
    int src_stride_1;
    int src_limit_1;
} ExecOp;

typedef struct TranOp
{
    int len_limit;
    TranOpCode op_code;
    int dst_peer_id;
    int dst_addr;
    int dst_stride;
    bool dst_clear;
    int dst_sb_addr;
    int dst_ain_addr;
    int src_addr;
    int src_stride;
} TranOp;

typedef struct AllocOp
{
    int addr;
    std::complex<float> data;
    AllocOpCode op_code;
} AllocOp;

#endif // OPDEF_H